package test3;
import java.util.Arrays;


//字节与字符串

public class Test3 {

    public static void main(String[] args) {
        String str="abcd";
        byte[] bytes=str.getBytes();
        System.out.println(Arrays.toString(bytes));//[97, 98, 99, 100]

    }

    public static void main1(String[] args) {
        byte[] bytes={97,98,99,100};
        String str=new String(bytes);
        System.out.println(str);//abcd
        System.out.println("====");
        String str1=new String(bytes,1,3);
        System.out.println(str1);//bcd
    }
}

